project(internation)

cmake_minimum_required(VERSION 2.4 FATAL_ERROR)

aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})

if(X86)

find_package(GTK2 REQUIRED)
mark_as_advanced(   GTK2_INCLUDE_DIRS   GTK2_LIBRARIES  )
include_directories(    gtkhpp  ${GTK2_INCLUDE_DIRS} )
target_link_libraries(  ${PROJECT_NAME} ${GTK2_LIBRARIES} )

else(X86)

# 设置CMake查找的根目录
set(CMAKE_FIND_ROOT_PATH "/home/jake/lib/sysroots/i686-linux/usr/")
# 设置不查找工具程序的位置
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# 设置只在CMAKE_FIND_ROOT_PATH设定目录下查找库文件
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
# 设置只在CMAKE_FIND_ROOT_PATH设定目录下查找头文件
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# 设置C语言编译器
SET(CMAKE_C_COMPILER "/home/jake/lib/sysroots/i686-linux/usr/armv7a/bin/arm-angstrom-linux-gnueabi-gcc")
set(CMAKE_CXX_COMPILER "/home/jake/lib/sysroots/i686-linux/usr/armv7a/bin/arm-angstrom-linux-gnueabi-g++")

# 向C/C++编译选项添加宏定义
add_definitions(-DARM)

set(SYSROOT_DIR "/home/jake/lib/sysroots/i686-linux")
include_directories(
			${SYSROOT_DIR}/usr/include/libxml2
			${SYSROOT_DIR}/usr/include/webkit-1.0
			${SYSROOT_DIR}/usr/include/libsoup-2.4
			${SYSROOT_DIR}/usr/include/gtk-2.0
			${SYSROOT_DIR}/usr/lib/gtk-2.0/include
			${SYSROOT_DIR}/usr/include/atk-1.0
			${SYSROOT_DIR}/usr/include/cairo
			${SYSROOT_DIR}/usr/include/pango-1.0
			${SYSROOT_DIR}/usr/include/gio-unix-2.0
			${SYSROOT_DIR}/usr/include/pixman-1
			${SYSROOT_DIR}/usr/include/freetype2
			${SYSROOT_DIR}/usr/include/libpng12
			${SYSROOT_DIR}/usr/include/glib-2.0
			${SYSROOT_DIR}/usr/lib/glib-2.0/include
                   )
target_link_libraries(  ${PROJECT_NAME}
			pthread
			gdk-x11-2.0
			gtk-x11-2.0
			atk-1.0
			pangoft2-1.0
			gdk_pixbuf-2.0
			m
			pangocairo-1.0
			cairo
			gio-2.0
			pango-1.0
			freetype
			fontconfig
			gobject-2.0
			gmodule-2.0
			gthread-2.0
			rt
			glib-2.0
			webkitgtk-1.0
			soup-2.4
			xml2
			fakekey
			X11
                     )
endif(X86)

add_compile_options(-g)
